<%--
  Created by IntelliJ IDEA.
  User: sunhao
  Date: 2014-11-27
  Time: 16:03
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%
	request.setAttribute("contextPath", request.getContextPath());
%>
<html>
<head>
<title>Save User</title>
<script type="text/javascript" src="${contextPath }/js/jquery-1.7.2.js"></script>
<script type="text/javascript">
	function checkData() {
		if ($("#categoryId").val() == "") {
			$("#errCategoryId").show();
			return false;
		}
		if ($("#bookName").val() == "") {
			$("#errBookName").show();
			return false;
		}
		if ($("#author").val() == "") {
			$("#errAuthor").show();
			return false;
		}
		if ($("#price").val() == "") {
			$("#errPrice").show();
			return false;
		}

		if ($("#press").val() == "") {
			$("#errPress").show();
			return false;
		}
		if ($("#publishTime").val() == "") {
			$("#errPublishTime").show();
			return false;
		}
		if ($("#edition").val() == "") {
			$("#errEdition").show();
			return false;
		}
		if ($("#reserve").val() == "") {
			$("#errReserve").show();
			return false;
		}
		if ($("#score").val() == "") {
			$("#errScore").show();
			return false;
		}
		if ($("#").val() == "") {
			$("#err").show();
			return false;
		}
		if ($("#").val() == "") {
			$("#err").show();
			return false;
		}
		if ($("#").val() == "") {
			$("#err").show();
			return false;
		}
		if ($("#").val() == "") {
			$("#err").show();
			return false;
		}
		if ($("#").val() == "") {
			$("#err").show();
			return false;
		}
		if ($("#").val() == "") {
			$("#err").show();
			return false;
		}
		return true;
	}
</script>
</head>
<body>
	<a href="javaScript:history.go(-1)">返回</a>
	<br />
	<br />
	<form action="${contextPath }/admin/addBook" method="post" onsubmit="return checkData()">
		<table width="80%" border="1">
			<tr>
				<td>categoryId</td>
				<td><input type="text" value="" name="categoryId" id="categoryId" />
				<span id="errCategoryId" style="color: red; display: none">* 请输入该书的类别名！</span>
				</td>
			</tr>
			<tr>
				<td>bookName</td>
				<td><input type="text" value="" name="bookName" id="bookName" />
				<span id="errBookName" style="color: red; display: none">* 请输入书名！</span>
				</td>
			</tr>
			<tr>
				<td>author</td>
				<td><input type="text" value="" name="author" id="author" />
				<span id="errAuthor" style="color: red; display: none">* 请输入作者名！</span>
				</td>
			</tr>
			<tr>
				<td>price</td>
				<td><input type="text" value="" name="price" id="price" />
				<span id="errPrice" style="color: red; display: none">* 请输入书的价格！</span>
				</td>
			</tr>
			<tr>
				<td>press</td>
				<td><input type="text" value="" name="press" id="press"/>
				<span id="errPress" style="color: red; display: none">* 请输入书的出版社！</span>
				</td>
			</tr>
			<tr>
				<td>publishTime</td>
				<td><input type="text" value="" name="publishTime" id="publishTime" />
				<span id="errPublishTime" style="color: red; display: none">* 请输入出版时间！</span>
				</td>
			</tr>
			<tr>
				<td>edition</td>
				<td><input type="text" value="" name="edition" id="edition"/>
				<span id="errEdition" style="color: red; display: none">* 请输入版次！</span>
				</td>
			</tr>
			<tr>
				<td>pageNum</td>
				<td><input type="text" value="" name="pageNum" id="pageNum"/>
				<span id="errPageNum" style="color: red; display: none">* 请输入页数！</span>
				</td>
			</tr>
			<tr>
				<td>image_w</td>
				<td><input type="text" value="" name="image_w" />
				<span id="" style="color: red; display: none">* ！</span>
				</td>
			</tr>
			<tr>
				<td>image_b</td>
				<td><input type="text" value="" name="image_b" />
				<span id="" style="color: red; display: none">* ！</span>
				</td>
			</tr>
			<tr>
				<td>reserve</td>
				<td><input type="text" value="" name="reserve" id="reserve"/>
				<span id="errReserve" style="color: red; display: none">* 请输入库存！</span>
				</td>
			</tr>
			<tr>
				<td>score</td>
				<td><input type="text" value="" name="score" id="score"/>
				<span id="errScore" style="color: red; display: none">* 请输入评分！</span>
				</td>
			</tr>

		</table>
		<br /> <input type="submit" value="Save" /> <input type="reset"
			value="Reset" />
	</form>
</body>
</html>
